const express = require('express')

const app = express()

app.set('secret', '13ecdfrefwsd3')

// 接受跨域
app.use(require('cors')())
// 能够接受到表单提交的数据
app.use(express.json())
// 静态文件(让uploads下的所有文件可以通过/uploads来访问)
app.use('/uploads', express.static(__dirname + '/uploads'))


require('./plugins/db')(app)
require('./route/admin/index')(app)

app.listen(3000, () => {
  console.log('http://localhost:3000')
})